﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SanPham_NoiSX.ascx.cs" Inherits="SanPham_NoiSX" %>
<center>
    <asp:Panel ID="pnGroupGrid" runat="server" Width="700px">
        <asp:DataGrid ID="datagrid" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            OnItemCommand="datagrid_ItemCommand" OnItemDataBound="datagrid_ItemDataBound"
            OnPageIndexChanged="datagrid_PageIndexChanged" PageSize="20" Width="100%">
            <PagerStyle Mode="NumericPages" />
            <AlternatingItemStyle CssClass="DarkRow" />
            <ItemStyle CssClass="LightRow" />
            <Columns>
                <asp:BoundColumn HeaderText="id" Visible="true" DataField="id" ReadOnly="True"></asp:BoundColumn>
                <asp:BoundColumn DataField="noisx" HeaderText="Nơi sản xuất (xuất xứ)" ReadOnly="True">
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundColumn>
                <asp:TemplateColumn><ItemTemplate>
                    <asp:Button ID="cmdEdit" runat="server" CausesValidation="False" CommandName="cmdEdit"
                        Text="Sửa" Width="40" />
                </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateColumn>
                <asp:TemplateColumn>
                    <ItemTemplate>
                        <asp:Button CausesValidation="False" ID="cmdDelete" runat="server" Text="Xóa" Width="40"
                            CommandName="cmdDelete"></asp:Button>
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns><HeaderStyle CssClass="HeaderRow" Font-Bold="True" />
        </asp:DataGrid><asp:SqlDataSource ID="ds" runat="server" ConnectionString="<%$ ConnectionStrings:DBConnectionString %>"
            ProviderName="<%$ ConnectionStrings:DBConnectionString.ProviderName %>"></asp:SqlDataSource>
        <asp:Button ID="cmdAddNew" runat="server" OnClick="cmdAddNew_Click" Text="Thêm mới" />
    </asp:Panel>
    <asp:Panel ID="pnEdit" runat="server" Width="700px">
        <table
            border="0" cellpadding="0" cellspacing="5" class="Area" style="border-right: gray 1px solid;
            border-top: gray 1px solid; border-left: gray 1px solid; border-bottom: gray 1px solid"
            width="700">
            <tr>
                <td align="center" colspan="2" style="color: blue">
                    <asp:Label ID="Label1" runat="server"></asp:Label></td>
            </tr>
            <tr>
                    
                <td>Nơi sản xuất (xuất xứ)</td>
                <td>
                    <asp:TextBox ID="txtMa" runat="server" Enabled="true" Visible="false" Width="130px" ReadOnly="True" Height="23px"></asp:TextBox>
                    <asp:TextBox ID="txtNoiSX" runat="server" Enabled="true" Visible="true" Width="200px" ReadOnly="false" Height="23px"></asp:TextBox>
                </td>
            </tr>
             <tr>
                <td style="color: red; font-family: arial" align="center" colspan="2" 
                     height="10">
                    <asp:Label ID="lblError" runat="server"></asp:Label><asp:Label ID="lblUpdateStatus"
                        runat="server"></asp:Label></td>
            </tr>
            <tr>
                <td align="center" colspan="2">
                    <asp:Button ID="cmdUpdate" runat="server" CausesValidation="true" OnClick="cmdUpdate_Click"
                        Text="Cập nhật" Width="72px" />
                    <asp:Button ID="cmdCancel" runat="server" CausesValidation="False" OnClick="cmdCancel_Click"
                        Text="Quay lại" Width="72" /></td>
            </tr>
        </table>
    </asp:Panel>
</center>